<?php
if(!defined('INEZCMS')){
	exit('Access Denied');
}

if($_GET['id']){
	$id=intval($_GET['id']);
}
if(!empty($_SESSION['EZ_Admin'])){
$article=$ezhand->select('thread',"*",'id="'.$id.'"');  
    
}else{
    
$article=$ezhand->select('thread',"*",'id="'.$id.'"');  
    
}

$MainNav="index";
if(empty($article)){
    
    error_html('页面不存在');
}
$catid=$article["catid"];
$modelid=$article["modelid"];

$data=array('f'=>'hits','e'=>'+','v'=>1);
$ezhand->update('thread',$data,'id="'.$id.'"');
if($modelid==0){

    $pageinfo=$ezhand->select('thread t,pages p',"t.id,t.title,t.thumb,p.content","t.id=p.tid and p.catid=".$catid);
    $pageinfo["content"]=str_replace("_ueditor_page_break_tag_","",$pageinfo["content"]);
        
    
}elseif($modelid>0){
  
$tablename=$ezhand->select('model',"tablename",'id="'.$modelid.'"');  


$detailrow=$ezhand->select($tablename,"*",'tid="'.$id.'"');  
         

}



$totalnum =  substr_count($detailrow["content"], '_ueditor_page_break_tag_') + 1;

if($totalnum){
	$conarr = explode('_ueditor_page_break_tag_', $detailrow["content"]);
	$page = empty($_GET['page'])?'1':intval($_GET['page']);
	$page_url = tu($id,"2",'');
	$pagestr = '<div id="pages">'.pageft($totalnum,1,$page_url,1).'</div>';
	$detailrow["content"] =$conarr[$page-1];
}
?>